package sh.wn36.vehiclemanage.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import sh.wn36.vehiclemanage.entity.Car;
import sh.wn36.vehiclemanage.entity.Driver;
import sh.wn36.vehiclemanage.mapper.CarMapper;
import sh.wn36.vehiclemanage.mapper.DriverMapper;
import sh.wn36.vehiclemanage.service.CarService;
import sh.wn36.vehiclemanage.service.DriverService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import sh.wn36.vehiclemanage.vo.carInfo;
import sh.wn36.vehiclemanage.vo.driverInfo;

import java.util.List;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xk
 * @since 2021-04-26
 */
@Service
public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements CarService {

    @Autowired
    private CarMapper carMapper;
    @Override
    public IPage<carInfo> getAll1(Page<carInfo> page, QueryWrapper<carInfo> queryWrapper) {
        return carMapper.selectAll(page,queryWrapper);
    }

    @Override
    public List<Car> getAll2() {
        return carMapper.selectAll2();

    }

    @Override
    public boolean setStatesToRepaired(Integer carId) {
        return carMapper.setStatesToRepaired(carId);
    }

    @Override
    public boolean setStatesToUseable(Integer carId) {
        return carMapper.setStatesToUseable(carId);
    }
}
